package cn.lysj.framework.coupon.controller;

import cn.lysj.framework.base.BaseController;
import cn.lysj.framework.common.annotation.CurrentUser;
import cn.lysj.framework.common.domain.User;
import cn.lysj.framework.common.utils.pagination.PageVo;
import cn.lysj.framework.common.utils.web.Resp;
import cn.lysj.framework.coupon.domain.BirthdayCouponConfig;
import cn.lysj.framework.coupon.service.BirthdayCouponConfigService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;

/**
 * @author zwj
 * @description 生日优惠券配置控制层
 * @create 2019-01-16 09:39:10
 **/
@Slf4j
@RestController
@Api(description = "生日优惠券配置管理接口")
@RequestMapping("/birthday_coupon_config")
public class BirthdayCouponConfigController extends BaseController<BirthdayCouponConfig>{

    @Resource
    private BirthdayCouponConfigService birthdayCouponConfigService;

    @Override
    public BirthdayCouponConfigService getService() {
        return birthdayCouponConfigService;
    }

    @Override
    public Resp list(BirthdayCouponConfig entity, PageVo pageVo){return null;}

    @Override
    public Resp update(BirthdayCouponConfig entity){return null;}

    @Override
    public Resp save(BirthdayCouponConfig entity){return null;}

    @GetMapping("/list_rewrite")
    public Resp listRewrite(@CurrentUser User user){
        return birthdayCouponConfigService.storeGetBirthdayCoupon(user.getStoreId());
    }

    @PostMapping("/add_birthday_coupon_config")
    public Resp addBirthdayCouponConfig(@CurrentUser User user,String[] couponIds ){
        return birthdayCouponConfigService.addBirthdayCouponConfig(user.getStoreId(),couponIds);
    }

    @PostMapping("/delete_birthday_coupon_config")
    public Resp deleteBirthdayCouponConfig(@CurrentUser User user,String birthdayCouponConfigId){
        return birthdayCouponConfigService.deleteBirthdayCouponConfig(user.getStoreId(),birthdayCouponConfigId);
    }




}
